/*
 * Copyright 2007 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.jtell.internal.config.xml;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 * <code>EventElement</code> accumulates and holds the information in an <code>&lt;event ...&gt;</code> configuration
 * element.
 * </p>
 * <p>
 * <strong>Thread Safety</strong><br/>
 * Instances of this class are not safe for multithreaded access.
 * </p>
 */
public class EventElement
{
    /**
     * <p>
     * Additional event attributes. 
     * </p>
     */
    private Map<String, String> m_attributes = new HashMap<String, String>();

    /**
     * <p>
     * The event class. 
     * </p>
     */
    private String m_eventClassName;

    /**
     * <p>
     * The source class. 
     * </p>
     */
    private String m_sourceClassName;

    /**
     * <p>
     * Construct a {@link EventElement} instance.
     * </p>
     */
    public EventElement()
    {
        super();
    }

    public EventElement addAttribute(final String name, final String value)
    {
        m_attributes.put(name, value);
        return this;
    }

    public Map<String, String> getAttributes()
    {
        return m_attributes;
    }

    public String getEventClassName()
    {
        return m_eventClassName;
    }

    public EventElement setEventClassName(String eventClassName)
    {
        m_eventClassName = eventClassName;
        return this;
    }

    public String getSourceClassName()
    {
        return m_sourceClassName;
    }

    public EventElement setSourceClassName(String sourceClassName)
    {
        m_sourceClassName = sourceClassName;
        return this;
    }
}
